package com.liner.animal;

public class AnimalTest {
    public static void main(String[] args) {
//        Animal animal = new Animal();  new 一个Animal的对象
        Animal[] animal = new Animal[4];  //new 一个Animal数组的对象




        Dog dog1 = new Dog("小黄", 9, "加菲色");
        Dog dog2 = new Dog("旺财", 15, "米白色");
        Dog dog3 = new Dog("大黄", 18, "黑色");
        Fish fish1 = new Fish("小花", 4, "红色");
        Fish fish2 = new Fish("大兵", 15, "浅蓝色");
        Chick chick1 = new Chick("小虚", 13, "蓝色");
        Chick chick2 = new Chick("小菜", 1, "绿色");
        Chick chick3 = new Chick("小鲲", 12, "粉色");

        dog1.swim();        //Dog类重写Swim接口
        dog1.drink();       //复用Animal类
        dog2.eat();         //Dog类重写Animal类
        dog3.lookHome();    //Dog类所独有的


        fish1.swim();       //Fish类重写Swim接口
        fish1.eat();        //Fish类重写Animal类
        fish2.drink();      //复用Animal类

        chick1.eat();       //Chick类重写Animal类
        chick2.layEggs();   //Chick类所独有的
        chick3.drink();     //复用Animal类


    }
}
